package com.shenmazong.serveredustudent.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shenmazong.serveredustudent.pojo.TbMajor;
import com.shenmazong.serveredustudent.service.TbMajorService;
import com.shenmazong.serveredustudent.mapper.TbMajorMapper;
import com.shenmazong.utils.ResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.lang.annotation.Retention;
import java.util.List;

/**
 *
 */
@Service
public class TbMajorServiceImpl extends ServiceImpl<TbMajorMapper, TbMajor>
    implements TbMajorService{

    @Autowired
    private TbMajorMapper majorMapper;

    @Override
    public ResultResponse getMajorByCollageId(long collageId) {
        if(collageId==0){
            return ResultResponse.FAILED(-1,"参数异常");
        }

       List<TbMajor> majors = majorMapper.getMajorByCollageId(collageId);

        return ResultResponse.SUCCESS(majors);
    }
}




